import request from "@/utils/request";

// 查询模型列表
export function getProcessList(data) {
  return request({
    url: "/actModel/page",
    method: "post",
    data,
  });
}

// 发布流程
export function publishProcess(data) {
  return request({
    url: "/actModel/deploy",
    method: "post",
    data,
  });
}
// 删除流程
export function deleteProcess(id) {
  return request({
    url: `/actModel/remove/${id}`,
    method: "post",
  });
}
// 更改流程状态
export function updateProcessState(data) {
  return request({
    url: `/actModel/suspendOrActive`,
    method: "post",
    data,
  });
}
// 查询模型分组列表
export function getModelGroupList(query) {
  return request({
    url: `/heart/ActGroup/list`,
    method: "get",
    params: query,
  });
}

//新增流程模型分组
export function addModelGroup(data) {
  return request({
    url: `/heart/ActGroup`,
    method: "post",
    data,
  });
}

//删除流程模型分组
export function deleteModelGroup(id) {
  return request({
    url: `/heart/ActGroup/${id}`,
    method: "delete",
  });
}

//获取模型分组列表详细信息
export function getModelGroupDetail(id) {
  return request({
    url: `/heart/ActGroup/${id}`,
    method: "get",
  });
}

//获取模型关联菜单列表
export function listModelMenu(query) {
  return request({
    url: "/actModel/menu/option",
    method: "get",
    params: query,
  });
}

//获取菜单和模型关联模型列表
export function getmenuToModelList(query) {
  return request({
    url: "/heart/ActMenu/list",
    method: "get",
    params: query,
  });
}
//获取菜单和模型关联模型详情
export function getmenuToModelDetail(id) {
  return request({
    url: `/heart/ActMenu/${id}`,
    method: "get",
  });
}

//获取菜单和模型关联模型
export function getmenuToModel(id) {
  return request({
    url: `/actModel/menu/${id}`,
    method: "get",
  });
}
